package cn.zhukelili.guava;

import com.google.common.collect.*;

/**
     * 创建不可变集合
     * @author hhbeast
     * @create 2018-12-10-9:17
     **/
    public class ImmutableCollectionDemo {
        public static void main(String[] args) {
            ImmutableList<String> imuutableList = ImmutableList.of("a","b","c");
            ImmutableSet<String> immutableSet = ImmutableSet.of("e1","e2","e3");
            ImmutableMap immutableMap = ImmutableMap.of("k1","v1","k2","v2");

            System.out.println(imuutableList);


            Multimap<String,Integer> map = ArrayListMultimap.create();
            map.put("aa", 1);
            map.put("aa", 2);
            System.out.println(map.get("aa"));
        }
    }
